package com.bdqn.crm.filter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public class InterceptorConfig implements WebMvcConfigurer {
    private String[] excludePathPatterns;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String[] pathPatterns={"/**"};//拦截路径规则
        String[] excludePathPatterns={"/login","/regist","/statics/**"};//排除路径规则
        registry.addInterceptor(new AuthorizationInterceptor())//ZC拦截器
                .addPathPatterns(pathPatterns)//添加路径规则
                .excludePathPatterns(excludePathPatterns);
    }
}
